import {http} from "@/utils/http.js";

/**
 *  新增或更新档案信息
 * @param
 */
export const archivesSaveOrUpdateApi = (data) => {
    return http({
        method: "POST",
        url: "/v1/archives/saveOrUpdate",
        data
    });
};


/**
 *  获取手机号码
 * @param
 */
export const loginGetPhoneNumberApi = (data) => {
    return http({
        method: "POST",
        url: "/v1/login/getPhoneNumber",
        data
    });
};


/**
 *  登录接口
 * @param
 */
export const loginWechatApi = (data) => {
    return http({
        method: "POST",
        url: "/v1/login/wechat",
        data
    });
};


/**
 *  获取用户信息
 * @param
 */
export const userInfoApi = (userId) => {
    return http({
        method: "GET",
        url: `/v1/user/getUserInfo/${userId}`,
    });
};


/**
 * 上传文件
 * @param
 */
export const commonUpload = (userId) => {
    return http({
        method: "POST",
        url: '/common/upload',
    });
};


/**
 * 更新用户信息
 * @param
 */
export const userUpdataApi = (data) => {
    return http({
        method: "POST",
        url: '/v1/user/update',
        data
    });
};


/**
 *  获取配置
 * @param
 */
export const getConfigApi = () => {
    return http({
        method: "GET",
        url: `/v1/protocols/getConfig`,
    });
};


/**
 *   获取菜单
 * @param
 */
export const getGridListApi = () => {
    return http({
        method: "GET",
        url: `/v1/protocols/getGridList`,
    });
};


/**
 *    秘钥
 * @param
 */
export const getCozeKeyApi = () => {
    return http({
        method: "GET",
        url: `/v1/protocols/getCozeKey`,
    });
};

export const saveOrUpdate = () => {
    return http({
        method: "POST",
        url: `/v1/menu/saveOrUpdate`,
    });
};

export const jingsuan = (data) => {
    return http({
        method: "POST",
        header: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: `/yuanfenju/index.php/v1/Bazi/jingsuan`,
        data
    });
};


export const isShowEl = () => {
    return http({
        method: "POST",
        url: `/v1/menu/isShowEl`,
    });
};


export const getJingSuan = (data) => {
    return http({
        method: "POST",
        url: `/v1/yfg/jingsuan`,
        data

    });
};

export const getWeilai = (data) => {
    return http({
        method: "POST",
        url: `/v1/yfg/weilai`,
        data

    });
};

